﻿@model IfSoft.OA.Entities.BankBill
@using IfSoft.OA.Common
@using IfSoft.OA.Business;
@{
    ViewBag.Title = "Details";
}

<h2>详细信息</h2>

<div class="text-right">
    @if (BankBillHelper.IsCanEdit(User.Identity.Name, Model))
    {
        @Html.ActionLink("编辑", "Edit", new { id = Model.Id });
        @Html.Raw("|");
    }
    @if (BankBillHelper.IsCanApproveOrDeny(User.Identity.Name, Model))
    {
            @Html.ActionLink("批准", "Approve", new { id = Model.Id });
            @Html.Raw("|");                                                                         
            @Html.ActionLink("拒绝", "Deny", new { id = Model.Id });
            @Html.Raw("|");
    }     
    @Html.ActionLink("返回", "Index")
</div>

<table class="details-table">
     <tr>
        <th>日期</th>
        <td>@CommonHelper.FormatedNullableDate(Model.PayDate)</td>
        <th></th>
        <td></td>
    </tr>
    <tr><td colspan="4"></td></tr>
    <tr>
        <th>付款公司</th>
        <td>@Html.DisplayFor(model => model.PayCompany)</td>
        <th>部门</th>
        <td>@Html.DisplayFor(model => model.PayDepartment)</td>
    </tr>   
    <tr>
        <th>付款方式</th>
        <td>@Html.DisplayFor(model => model.PayType)</td>
        <th>付款银行</th>
        <td>@Html.DisplayFor(model => model.PayBank)</td>
    </tr>
    <tr><td colspan="4"></td></tr>
    <tr>    
        <th>金额小写</th>
        <td>@Html.DisplayFor(model => model.Amount)</td>
        <th>金额大写</th>
        <td>@Html.DisplayFor(model => model.AmountInCN)</td>
    </tr>
    <tr>    
        <th>货币类别</th>
        <td>@Html.DisplayFor(model => model.Currency)</td>
        <th>最后付款日期</th>
        <td>@CommonHelper.FormatedNullableDate(Model.Deadline)</td>
    </tr>
    <tr>    
        <th>付款凭证</th>
        <td>@Html.DisplayFor(model => model.PayNoteType)</td>
        <th>票据号码</th>
        <td>@Html.DisplayFor(model => model.PayNoteNo)</td>
    </tr>
    <tr><td colspan="4"></td></tr>
    <tr>    
        <th>收款公司</th>
        <td>@Html.DisplayFor(model => model.ReceiveCompany)</td>
        <th></th>
        <td></td>
    </tr>
    <tr>    
        <th>收款银行</th>
        <td>@Html.DisplayFor(model => model.ReceiveBank)</td>
        <th>收款帐号</th>
        <td>@Html.DisplayFor(model => model.ReceiveAccountNo)</td>
    </tr>
    <tr><td colspan="4">付款内容及用途 [正式版将开启自动提醒功能]</td></tr>
    @if (Model != null && Model.BankBillDetails != null && Model.BankBillDetails.Count > 0)
    {
        foreach (var detail in Model.BankBillDetails)
        { 
              <tr id="@string.Format("{0}-{1}", "bankBillDetail", detail.Id)">
                <th>日期</th>
                <td>@CommonHelper.FormatedNullableDate(detail.KeyDate) <a onclick="deleteDetail(@detail.Id); return false;">删除</a></td>
                <th>描述</th>
                <td>@detail.Description</td>
            </tr>   
        }
    }     
   
    <tr><td colspan="4">批准信息</td></tr>
    <tr>    
        <th>申请人</th>
        <td>@Html.DisplayFor(model => model.Step1)</td>
        <th>申请日期</th>
        <td>@CommonHelper.FormatedNullableDate(Model.Step1Date)</td>
    </tr>
    <tr>    
        <th>部门负责人</th>
        <td>@Html.DisplayFor(model => model.Step2)</td>
        <th>批准日期</th>
        <td>@CommonHelper.FormatedNullableDate(Model.Step2Date)</td>
    </tr>
    <tr>    
        <th>财务部</th>
        <td>@Html.DisplayFor(model => model.Step3)</td>
        <th>批准日期</th>
        <td>@CommonHelper.FormatedNullableDate(Model.Step3Date)</td>
    </tr>
    <tr>    
        <th>监事长</th>
        <td>@Html.DisplayFor(model => model.Step4)</td>
        <th>批准日期</th>
        <td>@CommonHelper.FormatedNullableDate(Model.Step4Date)</td>
    </tr>
    <tr>    
        <th>总裁</th>
        <td>@Html.DisplayFor(model => model.Step5)</td>
        <th>批准日期</th>
        <td>@CommonHelper.FormatedNullableDate(Model.Step5Date)</td>
    </tr>
    <tr><td colspan="4">相关附件</td></tr>
    <tr>    
        <th>附件描述</th>
        <td>汇票复印件</td>
        <th>附件下载</th>
        <td><a href="_blank">下载</a></td>
    </tr>
    <tr>    
        <th>附件描述</th>
        <td>汇票复印件</td>
        <th>附件下载</th>
        <td><a href="_blank">下载</a></td>
    </tr>
</table>